package com.zhang.zxx.boot.trans;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.resolver.TransObjResolver;
import com.zhang.zxx.boot.common.base.Response;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ResultResolver implements TransObjResolver {
    @Override
    public boolean support(Object obj) {
        return obj instanceof Response;
    }

    @Override
    public Object resolveTransObj(Object obj) {
        // return ((Response<?>) obj).getData();
        // 上面的也可以
        return ((Response<IPage<?>>) obj).getData();
    }

}
